<div xmlns:ext="http://www.extjs.com" class="body-wrap"><h1>Class <a href="source/Filter.html#cls-Ext.util.Filter">Ext.util.Filter</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.util</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/Filter.html#cls-Ext.util.Filter">Filter.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Filter.html#cls-Ext.util.Filter">Filter</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr></table><div class="description"><p>Represents a filter that can be applied to a <a href="output/Ext.data.MixedCollection.html" ext:cls="Ext.data.MixedCollection">MixedCollection</a>. Can either simply
filter on a property/value pair or pass in a filter function with custom logic. Filters are always used in the context
of MixedCollections, though <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Store</a>s frequently create them when filtering and searching on their
records. Example usage:</p>
<pre><code><i>//set up a fictional MixedCollection containing a few people to filter on</i>
<b>var</b> allNames = <b>new</b> Ext.util.MixedCollection();
allNames.addAll([
    {id: 1, name: <em>'Ed'</em>,    age: 25},
    {id: 2, name: <em>'Jamie'</em>, age: 37},
    {id: 3, name: <em>'Abe'</em>,   age: 32},
    {id: 4, name: <em>'Aaron'</em>, age: 26},
    {id: 5, name: <em>'David'</em>, age: 32}
]);

<b>var</b> ageFilter = <b>new</b> Ext.util.Filter({
    property: <em>'age'</em>,
    value   : 32
});

<b>var</b> longNameFilter = <b>new</b> Ext.util.Filter({
    filterFn: <b>function</b>(item) {
        <b>return</b> item.name.length > 4;
    }
});

<i>//a <b>new</b> MixedCollection <b>with</b> the 3 names longer than 4 characters</i>
<b>var</b> longNames = allNames.filter(longNameFilter);

<i>//a <b>new</b> MixedCollection <b>with</b> the 2 people of age 24:</i>
<b>var</b> youngFolk = allNames.filter(ageFilter);</code></pre></div><div class="hr"></div><a id="Ext.util.Filter-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row  "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Filter-anyMatch"></a><b><a href="source/Filter.html#cfg-Ext.util.Filter-anyMatch">anyMatch</a></b> : Boolean<div class="mdesc">True to allow any match - no regex start/end line anchors will be added. Defaults to false</div></td><td class="msource">Filter</td></tr><tr class="config-row  "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Filter-caseSensitive"></a><b><a href="source/Filter.html#cfg-Ext.util.Filter-caseSensitive">caseSensitive</a></b> : Boolean<div class="mdesc">True to make the regex case sensitive (adds 'i' switch to regex). Defaults to false.</div></td><td class="msource">Filter</td></tr><tr class="config-row  "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Filter-exactMatch"></a><b><a href="source/Filter.html#cfg-Ext.util.Filter-exactMatch">exactMatch</a></b> : Boolean<div class="mdesc">True to force exact match (^ and $ characters added to the regex). Defaults to false.
Ignored if anyMatch is true.</div></td><td class="msource">Filter</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Filter-filterFn"></a><b><a href="source/Filter.html#cfg-Ext.util.Filter-filterFn">filterFn</a></b> : Function<div class="mdesc"><div class="short">A custom filter function which is passed each item in the Ext.util.MixedCollection 
in turn. Should return true to ac...</div><div class="long">A custom filter function which is passed each item in the <a href="output/Ext.util.MixedCollection.html" ext:cls="Ext.util.MixedCollection">Ext.util.MixedCollection</a> 
in turn. Should return true to accept each item or false to reject it</div></div></td><td class="msource">Filter</td></tr><tr class="config-row  "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Filter-property"></a><b><a href="source/Filter.html#cfg-Ext.util.Filter-property">property</a></b> : String<div class="mdesc">The property to filter on. Required unless a <a href="output/Ext.util.Filter.html#Ext.util.Filter-filter" ext:member="filter" ext:cls="Ext.util.Filter">filter</a> is passed</div></td><td class="msource">Filter</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Filter-root"></a><b><a href="source/Filter.html#cfg-Ext.util.Filter-root">root</a></b> : String<div class="mdesc"><div class="short">Optional root property. This is mostly useful when filtering a Store, in which case we set the
root to 'data' to make...</div><div class="long">Optional root property. This is mostly useful when filtering a Store, in which case we set the
root to 'data' to make the filter pull the <a href="output/Ext.util.Filter.html#Ext.util.Filter-property" ext:member="property" ext:cls="Ext.util.Filter">property</a> out of the data object of each item</div></div></td><td class="msource">Filter</td></tr></tbody></table><a id="Ext.util.Filter-props"></a><h2>Public Properties</h2><div class="no-members">This class has no public properties.</div><a id="Ext.util.Filter-methods"></a><h2>Public Methods</h2><div class="no-members">This class has no public methods.</div><a id="Ext.util.Filter-events"></a><h2>Public Events</h2><div class="no-members">This class has no public events.</div></div>